package org.huawei260.TiKu.ODsuanfa;

import java.util.Arrays;

/**
 * @Author: qingle
 * @Date: 2024/10/28-16:11
 * @Description: 3407 【DP】2024E-充电设备
 * @version: 1.0
 */
import java.util.Scanner;
public class E_2024E_3407__DP_充电设备 {

//	public class Main {
		public static void main(String[] args) {
			Scanner scanner = new Scanner(System.in);
			int D = scanner.nextInt(); // 甲乙两城的距离
			int N = scanner.nextInt(); // 休息站数量
			int[][] stations = new int[N][2]; // 休息站的距离和充电排队时间

			for (int i = 0; i < N; i++) {
				stations[i][0] = scanner.nextInt(); // 休息站距离
				stations[i][1] = scanner.nextInt(); // 充电排队时间
			}

			double[] dp = new double[N + 1];
			Arrays.fill(dp, Double.MAX_VALUE);
			dp[0] = 0;

			for (int i = 1; i <= N; i++) {
				int distanceToStation = stations[i - 1][0];
				int chargeTime = stations[i - 1][1];
				double travelTime = distanceToStation / 100.0; // 行驶时间

				// 不在该站充电
				dp[i] = Math.min(dp[i], dp[i - 1] + travelTime);

				// 在该站充电
				if (distanceToStation <= 1000) { // 确保有足够的电量到达该站
					dp[i] = Math.min(dp[i], dp[i - 1] + travelTime + 1 + chargeTime);
				}

				// 检查是否需要在后续的休息站充电
				for (int j = i; j <= N; j++) {
					int distanceToNextStation = stations[j - 1][0] - distanceToStation;
					if (distanceToNextStation > 1000) break; // 不能到达下一个休息站
					double totalTravelTime = distanceToNextStation / 100.0;
					dp[j] = Math.min(dp[j], dp[i - 1] + travelTime + 1 + chargeTime + totalTravelTime);
				}
			}

			double totalTravelTime = D / 100.0;
			double minTime = Math.min(dp[N], totalTravelTime);

			System.out.println(minTime);
		}
	}